
import '../../data/device_data_entity.dart';

deviceDataEntityFromJson(DeviceDataEntity data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['snCode'] != null) {
		data.snCode = json['snCode'].toString();
	}
	if (json['macCode'] != null) {
		data.macCode = json['macCode'].toString();
	}
	if (json['pid'] != null) {
		data.pid = json['pid'].toString();
	}
	if (json['sid'] != null) {
		data.sid = json['sid'].toString();
	}
	if (json['mn'] != null) {
		data.mn = json['mn'].toString();
	}
	if (json['sn'] != null) {
		data.sn = json['sn'].toString();
	}
	if (json['mac'] != null) {
		data.mac = json['mac'].toString();
	}
	if (json['createTime'] != null) {
		data.createTime = json['createTime'].toString();
	}
	if (json['updateTime'] != null) {
		data.updateTime = json['updateTime'].toString();
	}
	if (json['deleted'] != null) {
		data.deleted = json['deleted'] is String
				? int.tryParse(json['deleted'])
				: json['deleted'].toInt();
	}
	if (json['signBy'] != null) {
		data.signBy = json['signBy'] is String
				? int.tryParse(json['signBy'])
				: json['signBy'].toInt();
	}
	if (json['relevanceBy'] != null) {
		data.relevanceBy = json['relevanceBy'].toString();
	}
	if (json['status'] != null) {
		data.status = json['status'].toString();
	}
	if (json['t'] != null) {
		data.t = json['t'].toString();
	}
	return data;
}

Map<String, dynamic> deviceDataEntityToJson(DeviceDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['snCode'] = entity.snCode;
	data['macCode'] = entity.macCode;
	data['pid'] = entity.pid;
	data['sid'] = entity.sid;
	data['mn'] = entity.mn;
	data['sn'] = entity.sn;
	data['mac'] = entity.mac;
	data['createTime'] = entity.createTime;
	data['updateTime'] = entity.updateTime;
	data['deleted'] = entity.deleted;
	data['signBy'] = entity.signBy;
	data['relevanceBy'] = entity.relevanceBy;
	data['status'] = entity.status;
	data['t'] = entity.t;
	return data;
}